﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProvaBD
{
    public partial class Form2 : Form
    {
        int id;
        public Form2()
        {
            InitializeComponent();
        }

        public void setAlumne(Alumne a)
        {
            lblNom.Text = a.propertyNom;
            lblCognom.Text = a.propertyCognom;
            lblTelefon.Text = a.propertyTelefon.ToString();
            id = a.propertyMatricula;
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnModificar_Click(object sender, EventArgs e)
        {
            AlumneConversor a = new AlumneConversor();
            a.propertyNom = lblNom.Text;
            a.propertyCognom = lblCognom.Text;
            a.propertyTelefon = lblTelefon.Text;
            a.propertyMatricula = id;
            a.modificarAlumne();
            this.Close();
        }
    }
}
